package cn._2dland.http;

public class NameValuePair implements Comparable<NameValuePair> {
	public String name;
	public String value;

	public NameValuePair() {}

	public NameValuePair(String name, String value) {
		this.name = name;
		this.value = value;
	}

	public void set(String name, String value){
		this.name = name;
		this.value = value;
	}

	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append(name).append("=").append(value);
		return buf.toString();
	}

	@Override
	public int compareTo(NameValuePair o) {
		// 使用字符串的比较方式
		return this.toString().compareTo(o.toString());
	}
}
